package demo2;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86138
 * Date: 2024-07-09
 * Time: 17:05
 */
public class Test {

    public static void eatprint(Animal animal){
        animal.eat();
    }

    public static void main(String[] args) {
        Cat cat = new Cat("小黑",2);
        Dog dog = new Dog("旺财",1);

        eatprint(dog);
        eatprint(cat);

    }
}
